home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / gedit-2 / plugins / snippets / php.xml < prev    next >
Encoding:
Extensible Markup Language  |  2009-04-14  |  5.0 KB  |  225 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <snippets language="PHP">
  3.   <snippet id="class">
  4.     <text><![CDATA[#doc
  5. #    classname:    ${1:ClassName}
  6. #    scope:        ${2:PUBLIC}
  7. #
  8. #/doc
  9.  
  10. class ${1:ClassName} ${3:extends AnotherClass}
  11. {
  12.     #    internal variables
  13.     
  14.     #    Constructor
  15.     function __construct (${4:argument})
  16.     {
  17.         # code...
  18.         $0
  19.     }
  20.     ###    
  21.  
  22. }
  23. ###]]></text>
  24.     <description>class ..</description>
  25.     <tag>class</tag>
  26.   </snippet>
  27.   <snippet id="$">
  28.     <text><![CDATA[\$_COOKIE['${1:variable}']]]></text>
  29.     <description>COOKIE['..']</description>
  30.     <tag>$</tag>
  31.   </snippet>
  32.   <snippet id="do">
  33.     <text><![CDATA[do
  34. {
  35.     # code...
  36.     $0
  37. } while (${1:$a <= 10});]]></text>
  38.     <description>do .. while ..</description>
  39.     <tag>do</tag>
  40.   </snippet>
  41.   <snippet id="elseif">
  42.     <text><![CDATA[elseif (${1:condition})
  43. {
  44.     # code...
  45.     $0
  46. }]]></text>
  47.     <description>elseif ..</description>
  48.     <tag>elseif</tag>
  49.   </snippet>
  50.   <snippet id="else">
  51.     <text><![CDATA[else
  52. {
  53.     # code...
  54.     $0
  55. }]]></text>
  56.     <description>else ..</description>
  57.     <tag>else</tag>
  58.   </snippet>
  59.   <snippet id="$-1">
  60.     <text><![CDATA[\$_ENV['${1:variable}']]]></text>
  61.     <description>ENV['..']</description>
  62.     <tag>$</tag>
  63.   </snippet>
  64.   <snippet id="$-2">
  65.     <text><![CDATA[\$_FILES['${1:variable}']]]></text>
  66.     <description>FILES['..']</description>
  67.     <tag>$</tag>
  68.   </snippet>
  69.   <snippet id="foreach">
  70.     <text><![CDATA[foreach ($${1:variable} as $${2:key} => $${3:value})
  71. {
  72.     # code...
  73.     $0:
  74. }]]></text>
  75.     <description>foreach ..</description>
  76.     <tag>foreach</tag>
  77.   </snippet>
  78.   <snippet id="for">
  79.     <text><![CDATA[for ($${1:i} = ${2:0}; $${1:i} < $3; $${1:i}++)
  80. {
  81.     # code...
  82.     $0
  83. }]]></text>
  84.     <description>for ..</description>
  85.     <tag>for</tag>
  86.   </snippet>
  87.   <snippet id="function">
  88.     <text><![CDATA[${1:public }function ${2:FunctionName}($3)
  89. {
  90.     ${0:# code...}
  91. }]]></text>
  92.     <description>function ..</description>
  93.     <tag>function</tag>
  94.   </snippet>
  95.   <snippet id="$-3">
  96.     <text><![CDATA[\$_GET['${1:variable}']]]></text>
  97.     <description>GET['..']</description>
  98.     <tag>$</tag>
  99.   </snippet>
  100.   <snippet id="globals">
  101.     <text><![CDATA[\$GLOBALS['${1:variable}']${2: =} ${3:something} ${4:;}]]></text>
  102.     <description>$GLOBALS['..']</description>
  103.     <tag>globals</tag>
  104.   </snippet>
  105.   <snippet id="if?">
  106.     <text><![CDATA[$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};]]></text>
  107.     <description>$.. =</description>
  108.     <tag>iff</tag>
  109.   </snippet>
  110.   <snippet id="ifelse">
  111.     <text><![CDATA[if (${1:condition})
  112. {
  113.     ${2:# code...}
  114. }
  115. else
  116. {
  117.     ${3:# code...}
  118. }
  119. $0]]></text>
  120.     <description>if .. else ..</description>
  121.     <tag>ifelse</tag>
  122.   </snippet>
  123.   <snippet id="if">
  124.     <text><![CDATA[if (${1:condition})
  125. {
  126.     # code...
  127.     $0
  128. }]]></text>
  129.     <description>if ..</description>
  130.     <tag>if</tag>
  131.   </snippet>
  132.   <snippet id="incl1">
  133.     <text><![CDATA[include_once('${1:file}');$0]]></text>
  134.     <description>include_once</description>
  135.     <tag>inclo</tag>
  136.   </snippet>
  137.   <snippet id="incl">
  138.     <text><![CDATA[include('${1:file}');$0]]></text>
  139.     <description>include</description>
  140.     <tag>incl</tag>
  141.   </snippet>
  142.   <snippet id="array">
  143.     <text><![CDATA[$${1:arrayName} = array('$2'${3:,});]]></text>
  144.     <description>$.. = array</description>
  145.     <tag>array</tag>
  146.   </snippet>
  147.   <snippet id="php">
  148.     <text><![CDATA[<?php
  149.  
  150.     $0
  151.  
  152. ?>]]></text>
  153.     <description><?php .. ?></description>
  154.     <tag>php</tag>
  155.   </snippet>
  156.   <snippet id="$-4">
  157.     <text><![CDATA[\$_POST['${1:variable}']]]></text>
  158.     <description>POST['..']</description>
  159.     <tag>$</tag>
  160.   </snippet>
  161.   <snippet id="print">
  162.     <text><![CDATA[print "${1:string}"${2: . };]]></text>
  163.     <description>print ".."</description>
  164.     <tag>print</tag>
  165.   </snippet>
  166.   <snippet id="$-5">
  167.     <text><![CDATA[\$_REQUEST['${1:variable}']]]></text>
  168.     <description>REQUEST['..']</description>
  169.     <tag>$</tag>
  170.   </snippet>
  171.   <snippet id="req1">
  172.     <text><![CDATA[require_once('${1:file}');]]></text>
  173.     <description>require_once</description>
  174.     <tag>reqo</tag>
  175.   </snippet>
  176.   <snippet id="req">
  177.     <text><![CDATA[require('${1:file}');]]></text>
  178.     <description>require</description>
  179.     <tag>req</tag>
  180.   </snippet>
  181.   <snippet id="$-6">
  182.     <text><![CDATA[\$_SERVER['${1:variable}']]]></text>
  183.     <description>SERVER['..']</description>
  184.     <tag>$</tag>
  185.   </snippet>
  186.   <snippet id="$-7">
  187.     <text><![CDATA[\$_SESSION['${1:variable}']]]></text>
  188.     <description>SESSION['..']</description>
  189.     <tag>$</tag>
  190.   </snippet>
  191.   <snippet id="case">
  192.     <text><![CDATA[case '${1:variable}':
  193.     # code...
  194.     $0
  195. break;]]></text>
  196.     <description>case ..</description>
  197.     <tag>case</tag>
  198.   </snippet>
  199.   <snippet id="switch">
  200.     <text><![CDATA[switch (${1:variable})
  201. {
  202.     case '${2:value}':
  203.         ${3:# code...}
  204.     break;
  205.     
  206.     $0
  207.             
  208.     default:
  209.         ${4:# code...}
  210.     break;
  211. }]]></text>
  212.     <description>switch ..</description>
  213.     <tag>switch</tag>
  214.   </snippet>
  215.   <snippet id="while">
  216.     <text><![CDATA[while (${1:$a <= 10})
  217. {
  218.     # code...
  219.     $0
  220. }]]></text>
  221.     <description>while ..</description>
  222.     <tag>while</tag>
  223.   </snippet>
  224. </snippets>
  225.